Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Try this [edited]

I once wrote a small LotusScript Function for this; see below. Hope it will work for you.
NO WARRANTIES (since this is for banks ;-)

<EDIT>
Ouch, 24 digits is more than the precision of a Double, so it won't work I'm afraid.
You'll probably have to resort to Java; see class BigInteger.
</EDIT>


'/**
' * Max Long value
' */
Public Const N_LS_MAXLONG& = 2147483647 ' &h7FFFFFFF

'/**
' * Performs a Modulo operation, where the left operand can be greater than <code>N_LS_MAXLONG</code>.
' * @param leftOp left operand
' * @param rightOp right operand
' * @return the value of <code>leftOp Mod rightOp</code>, if <code>Abs(leftOp) <= N_LS_MAXLONG</code>, otherwise the value of <code>leftOp - Fix(leftOp/rightOp) * rightOp</code>.
' * @error 11 (ErrDivisionByZero) if <code>rightOp</code> is zero.
' */
Public Function BigMod(ByVal leftOp As Double, ByVal rightOp As Long) As Long
If Abs(leftOp) <= N_LS_MAXLONG Then
BigMod = leftOp Mod rightOp
Else
BigMod = leftOp - Fix(leftOp/rightOp) * rightOp
End If
End Function


Feedback response number JSAK9G9PQW created by ~Tip Zekjumitexakol on 02/12/2014

modulo of big numbers (~Ben Asakilying... 12.Feb.14)
. . This thread on Stackoverflow looks ... (~Fritz Ekfoober... 12.Feb.14)
. . Bit by bit? (~Martha Lopjipy... 12.Feb.14)
. . Try this [edited] (~Fred Asatumibu... 12.Feb.14)
. . . . has a limit too (~Ben Asakilying... 12.Feb.14)
. . . . . . The problem is about numeric precis... (~Fred Asatumibu... 12.Feb.14)
. . Split it up into chunks (~Mark Froboosim... 13.Feb.14)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS